package com.exrobot.module.rbt.dal.mysql.robotfiles;

import java.util.*;

import com.exrobot.framework.common.pojo.PageResult;
import com.exrobot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.exrobot.framework.mybatis.core.mapper.BaseMapperX;
import com.exrobot.module.rbt.dal.dataobject.robotfiles.RobotFilesDO;
import org.apache.ibatis.annotations.Mapper;
import com.exrobot.module.rbt.controller.admin.robotfiles.vo.*;

/**
 * 机器人文件 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RobotFilesMapper extends BaseMapperX<RobotFilesDO> {

    default PageResult<RobotFilesDO> selectPage(RobotFilesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RobotFilesDO>()
                .likeIfPresent(RobotFilesDO::getName, reqVO.getName())
                .eqIfPresent(RobotFilesDO::getFileClass, reqVO.getFileClass())
                .eqIfPresent(RobotFilesDO::getType, reqVO.getType())
                .eqIfPresent(RobotFilesDO::getSize, reqVO.getSize())
                .eqIfPresent(RobotFilesDO::getUrl, reqVO.getUrl())
                .eqIfPresent(RobotFilesDO::getSort, reqVO.getSort())
                .betweenIfPresent(RobotFilesDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RobotFilesDO::getId));
    }

}